﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simple.Common.Data
{
    /// <summary>
    /// 视图数据基类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class Dto<T>
    {
        public virtual T Id { get; set; }

        /// <summary>
        /// 是否为新类
        /// </summary>
        /// <returns></returns>
        public virtual bool IsTransient()
        {
            return EqualityComparer<T>.Default.Equals(Id, default(T));
        }
    }
}
